package com.xjscrm.console.chat.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

/**
 * @author mingyang.chen create in 2024/3/12 17:11
 */
@Getter
@AllArgsConstructor
public enum ChatTalkRecordSource {

    receive(2020, "接受消息"),
    reply(2021, "回复消息"),
    ;

    private final Integer code;
    private final String desc;

    public static ChatTalkRecordSource getByCode(Integer code) {
        for (ChatTalkRecordSource value : ChatTalkRecordSource.values()) {
            if (Objects.equals(code, value.getCode())) {
                return value;
            }
        }
        return null;
    }
}
